<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

<script>
    const date = new Date()

    // 获取当前时间的时间戳的三种方法
    console.log(date.getTime())
    console.log(Date.now())
    console.log(+date)
    
    // 获取指定时间的时间戳
    console.log(+new Date("2028-01-01 11:18:12"))
    
</script>
    
</body>
</html>